package com.kasinf.sample.sky.filter;

import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain;
import reactor.core.publisher.Mono;

/**
 * @Author : Kaiser
 * @Date: 2025/7/9  13:54
 */
@Slf4j
@Component
@Order(-2)
public class SkyWalkingTraceWebFilter implements WebFilter {

    @Override
    @Trace
    public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
        log.info("SkyWalkingTraceWebFilter");
        return chain.filter(exchange);
    }
}
